test(conformance): expand golden-frame coverage#6
Conversation
Add a golden-frame conformance case for a CALL frame whose CBOR body contains an explicit boolean and a short string.
This pins non-numeric scalar encoding byte-for-byte using the `set_enabled` intent with `{enabled: true, label: "ok"}` so ports can verify canonical CBOR output against the corpus.
Co-Authored-By: OpenAI GPT-5.4 <noreply@openai.com>
Add a golden-frame conformance case for a REPLY frame whose payload is encoded as an explicit CBOR empty map.
This complements the existing empty CALL coverage using a reply with `payload: {}` and `cbor_hex: "a0"` so ports verify that explicit empty reply bodies decode the same way.
Co-Authored-By: OpenAI GPT-5.4 <noreply@openai.com>
Add a golden-frame conformance case for an ERROR frame whose CBOR body carries multiple fields.
This extends the current single-field error coverage using the `unknown` intent with `{status: 4, message: "unknown", code: 404}` so ports must preserve the full error map.
Co-Authored-By: OpenAI GPT-5.4 <noreply@openai.com>
Add a golden-frame conformance case for an EVENT frame whose CBOR body contains unsigned integer boundary values.
This pins canonical integer encoding byte-for-byte using the `motion_detected` intent with `{min: 0, max: 255}` so ports verify both single-byte and one-byte-argument unsigned forms.
Co-Authored-By: OpenAI GPT-5.4 <noreply@openai.com>
Add a golden-frame conformance case for a CALL frame whose sequence number uses mixed high and low bytes.
This exercises big-endian sequence encoding using `seq: 0xff01` with the `set_color` intent and `{r: 255, g: 100, b: 0}` so ports cannot accidentally treat sequence bytes as little-endian.
Co-Authored-By: OpenAI GPT-5.4 <noreply@openai.com>
Extend the golden-frame conformance corpus so the optional `uart_wire_hex` and `crc16` fields are exercised by a real fixture instead of documented-only contract text. Populate both fields on `call with three small ints`, then update the reference conformance runner to assert them when present. This pins the full frame CRC as well as the COBS-wrapped UART bytes emitted by `wrap(...)`, giving ports a concrete byte-for-byte target for framing behavior in addition to the existing header and CBOR-body checks. Also sync the conformance README to the current `cbor_hex` schema and clarify that `uart_wire_hex` represents wrapped frame+CRC bytes without the trailing delimiter byte. Co-Authored-By: OpenAI GPT-5.4 <noreply@openai.com>
WaylandYang
left a comment
There was a problem hiding this comment.
Thanks for this, Alex — it's a genuinely strong contribution and I went through it properly rather than rubber-stamping.
I verified the new golden frames byte-by-byte:
- The CBOR for the multi-field error payload, the bool+string payload, and the integer-boundary event all encode correctly.
- The COBS+CRC pinning you added to the three-ints case is exactly right —
12 [17 non-zero bytes] 03 94 ef, CRC-16/CCITT0x94ef, and the7a22header is the correct intent_id forset_color.
You also caught a real stale-doc bug: the README described the fixture field as wire_hex when the corpus has actually used cbor_hex for a while. Good catch — that's exactly the kind of drift outside eyes find.
The conformance corpus is the part of the project that benefits most from outside review, so this is very welcome. Approving now; I'll merge once CI is green.
If you'd be interested in more: the YAML corpus is deliberately language-neutral, and the single biggest thing the project needs before a v1.0 freeze is a second-language conformance runner — a port of test_conformance.py to C, Rust, or Go (your call). That would be a substantial, self-contained piece if you're looking for one. No pressure either way — thanks for taking the time on this.
|
Merged, thanks Alex. Clean PR. If you ever want to take a crack at the second-language conformance runner, ping me and I'll point you at the files. |
Adds a small GitHub Action (actions/first-interaction) that posts one short note the first time someone opens an issue or PR. Motivated by PR #6 — the project's first external contribution, which sat unnoticed for a day. A first contributor should get an immediate signal that the repo is alive and their work was seen. Uses pull_request_target so the token can comment on fork PRs; the action only posts a comment and never checks out or runs PR code, so the usual pull_request_target risk does not apply. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
What
Expand the DCP conformance golden-frame corpus with additional byte-level fixtures, and tighten the Python conformance runner so that optional UART wire bytes and CRC fields are asserted when present.
This also syncs the conformance README with the current fixture schema and adds the repository PR template to
CONTRIBUTING.md.Why
Downstream ports need more pinned protocol vectors for payload encoding, sequence-number bytes, explicit empty-map bodies, UART wrapping, and CRC behavior. These cases make the conformance corpus a stronger cross-language compatibility target without changing the protocol.
Spec impact
for what we expect from this kind of change
Checklist
ruff check src testspasses locallypytestpasses locally## [Unreleased](not updated: conformance test fixtures/docs only)docs/RATIONALE.mdareconsistent with the new behavior